a = int(input())
b = 0
for i in range (a):
    if a % i == 0:
        b += 1
if b <= 1:
    a = str(a)
    for i in a:
        pass
else:
    print:(0)
